const path = require('path');

let str = 'c:\\www\\a.html';

console.log(path.parse(str));

/* {
    root: 'c:\\',
    dir: 'c:\\www'
    base: 'a.html'
    ext: '.html',
    name: 'a'
} */
